package de.koller.so.gl;

import de.koller.million.render.Camera;
import de.koller.oceanFramework.gl.util.InputGL;
import de.koller.oceanFramework.tree.Child;
import de.koller.oceanFramework.tree.Sea3X;
import de.koller.so.gl.container.TextureContainer;
import de.koller.so.model.Polygon;
import de.koller.so.szene.Szene;
import de.koller.so.util.SOCamera;
import java.util.HashSet;
import java.util.Set;
import org.lwjgl.input.Keyboard;

public class SORootGL extends Sea3X {
	
	public final TextureContainer textureContainer = new TextureContainer();
	
	@Child public final SORendererGL sorenderer = new SORendererGL();
	public final Set<Polygon> polygons = new HashSet<>();
	
	@Child public final SOCamera flycamera = new SOCamera();
	@Child public final InputGL input = new InputGL();
	
	@Override
	protected void init() {
		super.init();
		
		this.setIgnoreChildRender( false );
	}

	@Override
	protected void postChildInit() {
		super.postChildInit();
		
		new Szene().setSzene( this );
	}

	@Override
	protected void render( int elapsedTime ) {
		super.render( elapsedTime );
		
		sorenderer.renderFast();
	}

	@Override
	protected void update( int elapsedTime ) {
		super.update( elapsedTime );
		
		if( input.isKeyPressed( Keyboard.KEY_F4 ) )
			flycamera.printLocation();
	}
	
	
}
